unit UMain;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,
  dxBar, dxRibbon, dxRibbonForm, dxRibbonSkins, cxGraphics, cxControls, cxLookAndFeels,
  cxLookAndFeelPainters, cxClasses, dxRibbonBackstageView, cxBarEditItem,
  dxRibbonCustomizationForm, cxTextEdit, cxContainer, cxEdit, dxSkinsForm, dxStatusBar,
  dxRibbonStatusBar, cxLabel, dxGallery, dxGalleryControl, dxRibbonBackstageViewGalleryControl,
  cxPC, dxBarBuiltInMenu, dxTabbedMDI, System.ImageList, Vcl.ImgList, cxImageList,
  System.Actions, Vcl.ActnList, dxSkinsCore, dxSkinWhiteprint, dxSkinBlue,
  dxSkinOffice2016Colorful;

type
  TfrmMain = class(TdxRibbonForm)
    dxBarManager1: TdxBarManager;
    dxBarManager1Bar1: TdxBar;
    dxRibbon1: TdxRibbon;
    dxRibbonBackstageView1: TdxRibbonBackstageView;
    dxRibbonBackstageViewTabSheet1: TdxRibbonBackstageViewTabSheet;
    dxRibbonStatusBar1: TdxRibbonStatusBar;
    dxRibbonBackstageViewGalleryControl1: TdxRibbonBackstageViewGalleryControl;
    cxLabel1: TcxLabel;
    dxRibbonBackstageViewGalleryControl1Group1: TdxRibbonBackstageViewGalleryGroup;
    dxSkinController1: TdxSkinController;
    dxRibbonBackstageViewGalleryControl1Group1Item1: TdxRibbonBackstageViewGalleryItem;
    cxBarEditItem1: TcxBarEditItem;
    tabMDIMgr: TdxTabbedMDIManager;
    cxLargeImages: TcxImageList;
    cxSmallImages: TcxImageList;
    dxRibbon1Tab1: TdxRibbonTab;
    dxBarManager1Bar2: TdxBar;
    btnThemeMgr: TdxBarLargeButton;
    btnDevCtrlMgr: TdxBarLargeButton;
    actLstMain: TActionList;
    actThemeMgr: TAction;
    actDevCtrlMgr: TAction;
    btnDevIOMgr: TdxBarLargeButton;
    actDevIOMgr: TAction;
    dxBarManager1Bar3: TdxBar;
    btnExecCmdMgr: TdxBarLargeButton;
    actExecCmdMgr: TAction;
    btnSyncData: TdxBarLargeButton;
    actSyncData: TAction;
    procedure FormCreate(Sender: TObject);
    procedure actThemeMgrExecute(Sender: TObject);
    procedure actDevCtrlMgrExecute(Sender: TObject);
    procedure actDevIOMgrExecute(Sender: TObject);
    procedure actExecCmdMgrExecute(Sender: TObject);
    procedure actSyncDataExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmMain: TfrmMain;

implementation

uses
  UThemeMgr, UDevCtrlMgr, UDevIOMgr, UExecCmdMgr, USyncDataMgr;

{$R *.dfm}

{ TForm1 }

procedure TfrmMain.actDevCtrlMgrExecute(Sender: TObject);
begin
  if Application.FindComponent('frmDevCtrlMgr') = nil then
  begin
    frmDevCtrlMgr := TfrmDevCtrlMgr.Create(Application);
    try
      frmDevCtrlMgr.Show;
    except
    end;
  end
  else
  try
    frmDevCtrlMgr.BringToFront;
  except

  end;
end;

procedure TfrmMain.actDevIOMgrExecute(Sender: TObject);
begin
  if Application.FindComponent('frmDevIOMgr') = nil then
  begin
    frmDevIOMgr := TfrmDevIOMgr.Create(Application);
    try
      frmDevIOMgr.Show;
    except
    end;
  end
  else
  try
    frmDevIOMgr.BringToFront;
  except

  end;
end;

procedure TfrmMain.actExecCmdMgrExecute(Sender: TObject);
begin
  if Application.FindComponent('frmExecCmdMgr') = nil then
  begin
    frmExecCmdMgr := TfrmExecCmdMgr.Create(Application);
    try
      frmExecCmdMgr.Show;
    except
    end;
  end
  else
  try
    frmExecCmdMgr.BringToFront;
  except
  end;
end;

procedure TfrmMain.actSyncDataExecute(Sender: TObject);
begin
  if Application.FindComponent('frmSyncDataMgr') = nil then
  begin
    frmSyncDataMgr := TfrmSyncDataMgr.Create(Application);
    try
      frmSyncDataMgr.ShowModal;
    finally
      frmSyncDataMgr.Free;
      frmSyncDataMgr := nil;
    end;
  end;
end;

procedure TfrmMain.actThemeMgrExecute(Sender: TObject);
begin
  if Application.FindComponent('frmThemeMgr') = nil then
  begin
    frmThemeMgr := TfrmThemeMgr.Create(Application);
    try
      frmThemeMgr.Show;
    except
    end;
  end
  else
  try
    frmThemeMgr.BringToFront;
  except

  end;
end;

procedure TfrmMain.FormCreate(Sender: TObject);
begin
  DisableAero := True;
end;

end.
